package com.sso.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "sso_DicSystem")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NamedQueries( {
		@NamedQuery(name = "system.getBySystem", query = "select system from DicSystem as system where system.systemName=?"),
		@NamedQuery(name = "system.getBySystemID", query = "select system from DicSystem as system where system.id=?") })
public class DicSystem {
	/**
	 * ID
	 */
	@Id
	private String id;

	/**
	 * 系统名称
	 */
	private String systemName;

	/**
	 * 系统描述
	 */
	private String systemRemark;
	
	/**
	 * 系统Url
	 */
	private String systemUrl;
	
	/**
	 * 系统服务地址
	 */
	private String systemServiceAddress;

	@OneToMany(mappedBy = "system", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	private Set<DicHuman> humans;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getSystemName() {
		return systemName;
	}

	public void setSystemName(String systemName) {
		this.systemName = systemName;
	}

	public String getSystemRemark() {
		return systemRemark;
	}

	public void setSystemRemark(String systemRemark) {
		this.systemRemark = systemRemark;
	}

	public Set<DicHuman> getHumans() {
		return humans;
	}

	public void setHumans(Set<DicHuman> humans) {
		this.humans = humans;
	}

	public String getSystemUrl() {
		return systemUrl;
	}

	public void setSystemUrl(String systemUrl) {
		this.systemUrl = systemUrl;
	}

	public String getSystemServiceAddress() {
		return systemServiceAddress;
	}

	public void setSystemServiceAddress(String systemServiceAddress) {
		this.systemServiceAddress = systemServiceAddress;
	}
}
